/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.mts.core.service;

import com.intelligent.mts.core.dto.*;
import com.intelligent.mts.core.entity.Production;

import java.util.List;
import java.util.Map;

/**
 * Created by cherry on 2016/7/26.
 */
public interface DataSearchService {

    void createProduction (ProductionDto productionDto);

    String updateProduction(String productionId1, String productionId2, String parentId);

    ProductionDto findProductionByProductionId (String productionId);

    List<ProductionDto> findByProductionIdOrParentId (String id);

    void createSerialNumber (SerialNumberDto serialNumberDto);

    void updateSerialNumber (SerialNumberDto serialNumberDto);

    List<SerialNumberDto> findSnBySerialValue (String serialValue);

    List<SerialNumberDto> findSnByStationId (String stationId, String productionId);

    SerialNumberDto findCondition (String productionId, String stationId, String snName);

    String findProductionIdBySerialValue (String serialValue);

    List<SerialNumberDto> findSnListByProductionId (String productionId);

    List<SerialNumberDto> findAllSnListBySerialValue (String serialValue);

    void createTrack (TrackDto trackDto);

    void update(TrackDto trackDto);

    TrackDto findTrackByProductionId (String productionId);

    TrackDto findTrackBySerialValue (String serialValue);

    void createAttribute (AttributeDto attributeDto);

    List<AttributeDto> findAttributeListBySerialValue (String serialValue);

    void createHistory (HistoryDto historyDto);

    void updateHistory (HistoryDto historyDto);

    List<HistoryDto> findHistoryListByProductionId (String productionId);

    List<HistoryDto> findHistoryListBySerialValue (String serialValue);

    ResultDto searchData (String serialValue);

    void updateCurrentStatusToOK (String productionId, String Status);


    boolean validateCustomer (String name);

    void createCustomer (CustomerDto customerDto);

    void createFinishGood (String customerName, String fgPn);

    void updateFinishGood (Map<String,String> pnMap, String Customer, String fgPn);

    void updateFinishGoodStatus (String status, String Customer,String fgPn);

    List<CustomerDto> findCustomers();

    List<String> findFgPnsByCustomer (String customerName);

    List<FinishGoodDto> findFinishGoodsByCustomerAndFgPn (String customerName, String fgPn);

    boolean validateFgPn (String fgPn);

    boolean validatePn(List<String> pn);

    String findPnByParentPrIdAndKey(String parentPrId, String key,String status);

    void updateProductionFgPn (String productionId, String fgPn);

    boolean validateFgPnByGwAndPcba(String fgPn, String gwPn, String pcbaPn);

    String findFgPnByProductionId(String productionId);

    String findFgPnByParentPrId(String parentPrId, String status);

    boolean validateParentPrIdIsExist (String parentProductionId);

    void updateProductionId (SerialNumberDto serialNumberDto);

    List<Production> findchildrenbyId (String productionId);

    void updateParProductionId (String HsproductionId, String HouproductionId, String parentId);

    String findHsProductionId (String productionId);
}

